#pragma once
#include "stdafx.h"
#include "FbxIO.h"
#include "FbxError.h"
#include "FbxString.h"

namespace Skill
{
	namespace FbxSDK
	{
		namespace IO
		{	
			void FbxIO::CollectManagedMemory()
			{
				_KError = nullptr;
			}			
			Version^ FbxIO::CurrentVersion::get()
			{					
				int minor,major,revision,build = 0;
				KFbxIO::GetCurrentVersion(major,minor,revision);
				return gcnew Version(major,minor,build,revision);
			}
			bool FbxIO::Initialize(String^ fileName)
			{				
				STRINGTO_CONSTCHAR_ANSI(f,fileName);				
				bool b = _Ref()->Initialize(f);
				FREECHARPOINTER(f);
				return b;
			}
			String^ FbxIO::FileName::get()
			{
				KString s = _Ref()->GetFileName();
				CONVERT_KSTRING_TO_STRING(s,str);
				return str;
			}				

			REF_PROPERTY_GET_DEFINATION_FROM_VALUE(FbxIO,GetError(),FbxError,KError);

			FbxIO::Error FbxIO::LastErrorID::get()					
			{
				return (Error)_Ref()->GetLastErrorID();
			}				
			String^ FbxIO::LastErrorString::get()
			{
				return gcnew String(_Ref()->GetLastErrorString());
			}				
			void FbxIO::GetMessage(FbxString^ message)
			{
				_Ref()->GetMessage(*message->_Ref());
			}


		}
	}
}